// import com.alibaba.druid.sql.ast.SQLExpr;
// import com.alibaba.druid.sql.ast.SQLReplaceable;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

#include "SQLShowACLStatement.h"
#include "../../visitor/SQLASTVisitor.h"
#include "SQLExprTableSource.h"

SQLExprTableSource_ptr SQLShowACLStatement::getTable()
{
  return table;
}

void SQLShowACLStatement::setTable(SQLExprTableSource_ptr x)
{
  if (x != nullptr)
  {
    x->setParent(SharedObject(SQLShowACLStatement));
  }
  this->table = x;
}

// @Override
void SQLShowACLStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLShowACLStatement)))
  {
    if (table != nullptr)
    {
      table->accept(visitor);
    }
  }
}

// @Override
BOOL_ptr SQLShowACLStatement::replace(SQLExpr_ptr expr, SQLExpr_ptr target)
{
  if (table != nullptr)
  {
    return table->replace(expr, target);
  }

  return BOOL::FALSE;
}
